<div class="container" ng-controller="manageRecvDetailController">
    <div class="row">
        <div class="col-xs-12">
            <!--<h4 class="text-name">{{ mission.mission_name }}</h4>-->
            <h4 ng-show="inputMissionName == 0" class="text-name input-modify" ng-click="inputMissionName = 1">{{ mission.mission_name }}</h4>
            <input type="text" ng-hide="inputMissionName == 0" id="inputMissionName" class="form-control input-modify" ng-model="mission.mission_name"/>

            <h6 class="text-tips">2小时前发布</h6>
            <input type="hidden" id="missionId" value="<{$mission_id}>">
        </div>
    </div>

    <!-- Valid time and public config -->
    <div class="row">
        <label for="inputValid" class="col-xs-12 control-label sm-label">任务有效期</label>
        <div class="col-xs-12">
            <select id="inputValid" class="form-control" ng-model="mission.valid_time" ng-options="m.value as m.name for m in validTimes">
                <option value="">--请选择--</option>
            </select>
        </div>
        <div class="col-xs-12">
            <h6 class="text-tips">选择后，任务有效期将从现在开始计算</h6>
            <div class="checkbox">
                <label>
                    <input type="checkbox" ng-model="isPhonePublic">发布本活儿时公开电话，结束后恢复原状态
                </label>
            </div>
            <div class="checkbox">
                <label>
                    <input type="checkbox" ng-model="isAgentPublic">适用于您的代表机构（私活儿可不勾选）
                </label>
            </div>
        </div>
    </div>

    <!-- Task description -->
    <div class="row">
        <div class="col-xs-12">
            <dl class="dl-horizontal-single dl-modify">
                <dt>岗位需求：</dt>
                <dd class="input-modify" ng-click="clearInputs(); inputJobs = 1">
                    <span ng-hide="inputJobs == 1">{{ jobMeaning }}&nbsp;</span>
                    <ul ng-show="inputJobs == 1" class="ul-tag" id="inputJobs">
                        <li ng-repeat="job in jobs" ng-class="{active: job.active == true}" ng-click="jobClick($index)">
                            {{ job.stat_name }}
                        </li>
                    </ul>
                </dd>
                <dt>工作时限：</dt>
                <dd class="input-modify" ng-click="clearInputs(); inputDuration = 1">
                    <span ng-hide="inputDuration == 1"> {{ durationMeaning }}&nbsp;</span>
                    <ul ng-show="inputDuration == 1" class="ul-tag" id="inputDuration">
                        <li ng-repeat="duration in durations" ng-class="{active: duration.active == true}" ng-click="durationClick($index)">
                            {{ duration.name }}
                        </li>
                    </ul>
                </dd>
                <dt>薪酬范围：</dt>
                <dd class="input-modify" ng-click="clearInputs(); inputSalary = 1">
                    <span ng-hide="inputSalary == 1">{{ transSalary() }}&nbsp;</span>
                    <div ng-show="inputSalary == 1"  id="inputSalary">
                        <select class="form-control" ng-model="mission.salary1" ng-options="m.id as m.name for m in salary">
                            <option value="">--请选择--</option>
                        </select>
                        <input type="number" class="form-control" ng-show="salary1 == 1" ng-model="salary2" placeholder="输入薪酬数额">
                    </div>
                </dd>
                <dt>工作地点：</dt>
                <dd class="input-modify" ng-click="clearInputs(); inputLocation = 1">
                    <span ng-hide="inputLocation == 1">{{ transLocation() }}&nbsp;</span>
                    <div ng-show="inputLocation == 1" class="row" id="inputLocation">
                        <div class="col-xs-4">
                            <select class="form-control" ng-model="mission.location1" ng-options="m.id as m.name for m in locations">
                                <option value="">--请选择--</option>
                            </select>
                        </div>
                        <div ng-show="location1 == 3">
                            <div class="col-xs-4">
                                <select id="selectP" class="form-control" ng-model="province" ng-options="m for m in provinces">
                                    <option value="">--省份--</option>
                                </select>
                            </div>
                            <div class="col-xs-4">
                                <select class="form-control" ng-model="city" ng-options="m for m in cities">
                                    <option value="">--城市--</option>
                                </select>
                            </div>
                        </div>
                    </div>
                </dd>
            </dl>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12">
            <dl class="dl-single dl-modify">
                <dt>详细描述：</dt>
                <dd class="input-modify" ng-click="clearInputs(); inputDesc = 1">
                    <span ng-hide="inputDesc == 1">{{ mission.description }}&nbsp;</span>
                    <textarea ng-show="inputDesc == 1" rows="4" id="inputDesc" class="form-control" ng-model="mission.description"></textarea>
                </dd>
            </dl>
        </div>
    </div>

    <!-- Followers and receivers -->
    <div ng-show="mission.receive">
        <div class="row">
            <div class="col-xs-12 col-panel-profile">
                <h5>要了的乙方</h5>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12 wrap-col-cont">
                <div class="row">
                    <div class="col-xs-12">
                        <ul class="ul-user">
                            <li ng-repeat="user in mission.receive">
                                <img ng-src="__PUBLIC__/{{ user.image_url }}" width="50px" height="50px">
                                <p class="text-name">
                                    <a href="<{:U('FetcherInfo/index')}>/user_id/{{ user.user_id }}">{{ user.user_name }}</a>
                                </p>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div ng-show="mission.follow">
        <div class="row">
            <div class="col-xs-12 col-panel-profile">
                <h5>申请的乙方</h5>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12 wrap-col-cont">
                <div class="row">
                    <div class="col-xs-12">
                        <ul class="ul-user">
                            <li ng-repeat="user in mission.follow">
                                <img ng-src="__PUBLIC__/{{ user.image_url }}" width="50px" height="50px">
                                <p class="text-name">
                                    <a href="<{:U('FetcherInfo/index')}>/user_id/{{ user.user_id }}">{{ user.user_name }}</a>
                                </p>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-xs-6 right">
            <button class="btn btn-main-short" ng-click="submit()" ng-disabled="!modified">发布</button>
            <h6 ng-show="modified" class="text-tips">修改过内容，重新发布！</h6>
        </div>
        <div class="col-xs-6 left">
            <button class="btn btn-main-short" ng-click="finish()">结束任务</button>
        </div>
    </div>
</div>